<?php
/**
 * Created by JetBrains PhpStorm.
 * User: Андрей
 * Date: 12.05.12
 * Time: 20:55
 * To change this template use File | Settings | File Templates.
 */

    /*
     * Абстрактный класс
     * для реализации Array Access
     */

    class ViewHelper implements ArrayAccess
    {
        public function offsetExists($offset)
        {
            $offset = '_' . $offset;
            return isset($this->$offset);
        }

        public function offsetGet($offset)
        {
            $offset = '_' . $offset;
            return $this->$offset;
        }

        public function offsetSet($offset,$value)
        {
            $offset = '_' . $offset;
            $this->$offset = $value;
        }

        public function offsetUnset($offset)
        {
            $offset = '_' . $offset;
            unset($this->$offset);
        }
    }
